﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ABMath.ModelFramework.Data;
using MathNet.Numerics.Distributions;
using MathNet.Numerics.RandomSources;
using NUnit.Framework;

namespace ABMath.Tests.ModelFramework.Data
{
    [TestFixture]
    public class TimeSeriesTest
    {
        private TimeSeries ts1;

        [SetUp]
        public void SetUp()
        {
        }

        /// <summary>
        /// Speed tester.
        /// </summary>
        [Test]
        public void RealTimeTest()
        {
            var sd = new StandardDistribution();

            ts1 = new TimeSeries();
            var dt = new DateTime(2001, 1, 1);
            for (int t = 0; t < 2000000; ++t)
            {
                double value = sd.NextDouble();
                ts1.Add(dt, value, false);
                dt = dt.AddSeconds(1);
            }

            DateTime start = DateTime.Now;
            DateTime middle = DateTime.Now;
            DateTime end = DateTime.Now;

            TimeSpan withCache = middle - start;
            TimeSpan withoutCache = end - middle;
        }
    }
}




